﻿<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>

    <title>FERI Forum</title>

	  <link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8"/>


      <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>

      <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>

      <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>

      <script type="text/javascript">

          function loadXMLDoc() {


              var xmlhttp = new XMLHttpRequest();
              xmlhttp.open("POST", "http://164.8.251.99:9793/services/cir2012/SiNf_UMNews?wsdl", false);
              xmlhttp.onreadystatechange = function () {
                  if (xmlhttp.readyState == 4) {
                      var xmlString = xmlhttp.responseText;

                      var parser = new DOMParser();
                      var xmlDoc = parser.parseFromString(xmlString, "application/xml");
                      var stevilo = xmlDoc.getElementsByTagName("naslov");

                      for (var i = 0; i < stevilo.length; i++) {
                          var naslov = xmlDoc.getElementsByTagName("naslov")[i].childNodes[0].nodeValue;
                          var opis = xmlDoc.getElementsByTagName("opis")[i].childNodes[0].nodeValue;
                          //var obvestilo = xmlDoc.getElementsByTagName("novica")[i].childNodes[0].nodeValue;
                          document.getElementById("main").innerHTML += "<h1>" + naslov + "</h1><p> " + opis +"</p><br/>";

                      }

                  }
              }


              xmlhttp.setRequestHeader("SOAPAction", "SiNf_UMNews");
              xmlhttp.setRequestHeader("Content-Type", "text/xml");
              var xml = '<?xml version="1.0" encoding="utf-8"?>' +
                '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
                                'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' +
                                'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
                '<soap:Body> ' +
                     '<SiNf_UMNews xmlns="http://services.mashup.wso2.org/SiNf_UMNews"> ' +
                     '</SiNf_UMNews> ' +
                   '</soap:Body> ' +
                '</soap:Envelope>';
              xmlhttp.send(xml);



          }



          document.addEventListener("deviceready", loadXMLDoc, false);

        </script>

</head>

<body>
    <h1>UM novice</h1>
    <div id="main"></div>
    
</body>

</html>